﻿using System;
using System.ComponentModel;
using System.IO;
using System.Runtime.Serialization;

namespace HalconDotNet
{
	/// <summary>Represents an instance of a descriptor model.</summary>
	// Token: 0x02000030 RID: 48
	[Serializable]
	public class HDescriptorModel : HHandle, ISerializable, ICloneable
	{
		// Token: 0x06000454 RID: 1108 RVA: 0x0000883B File Offset: 0x00006A3B
		[EditorBrowsable(EditorBrowsableState.Never)]
		public HDescriptorModel() : base(HHandleBase.UNDEF)
		{
		}

		// Token: 0x06000455 RID: 1109 RVA: 0x0001A46F File Offset: 0x0001866F
		[EditorBrowsable(EditorBrowsableState.Never)]
		public HDescriptorModel(IntPtr handle) : base(handle)
		{
			this.AssertSemType();
		}

		// Token: 0x06000456 RID: 1110 RVA: 0x0001A47E File Offset: 0x0001867E
		[EditorBrowsable(EditorBrowsableState.Never)]
		public HDescriptorModel(HHandle handle) : base(handle)
		{
			this.AssertSemType();
		}

		// Token: 0x06000457 RID: 1111 RVA: 0x0001A48D File Offset: 0x0001868D
		private void AssertSemType()
		{
			base.AssertSemType("descriptor_model");
		}

		// Token: 0x06000458 RID: 1112 RVA: 0x0001A49A File Offset: 0x0001869A
		internal static int LoadNew(IntPtr proc, int parIndex, int err, out HDescriptorModel obj)
		{
			obj = new HDescriptorModel(HHandleBase.UNDEF);
			return obj.Load(proc, parIndex, err);
		}

		// Token: 0x06000459 RID: 1113 RVA: 0x0001A4B4 File Offset: 0x000186B4
		internal static int LoadNew(IntPtr proc, int parIndex, int err, out HDescriptorModel[] obj)
		{
			HTuple htuple;
			err = HTuple.LoadNew(proc, parIndex, err, out htuple);
			obj = new HDescriptorModel[htuple.Length];
			for (int i = 0; i < htuple.Length; i++)
			{
				obj[i] = new HDescriptorModel(HalconAPI.IsLegacyHandleMode() ? htuple[i].IP : htuple[i].H);
			}
			htuple.Dispose();
			return err;
		}

		/// <summary>
		///   Read a descriptor model from a file.
		///   Modified instance represents: Handle of the model.
		/// </summary>
		/// <param name="fileName">File name.</param>
		// Token: 0x0600045A RID: 1114 RVA: 0x0001A524 File Offset: 0x00018724
		public HDescriptorModel(string fileName)
		{
			IntPtr proc = HalconAPI.PreCall(946);
			HalconAPI.StoreS(proc, 0, fileName);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			num = base.Load(proc, 0, num);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Create a descriptor model for calibrated perspective matching.
		///   Modified instance represents: The handle to the descriptor model.
		/// </summary>
		/// <param name="template">Input image whose domain will be used to create the model.</param>
		/// <param name="camParam">The parameters of the internal orientation of the camera.</param>
		/// <param name="referencePose">The reference pose of the object in the reference image.</param>
		/// <param name="detectorType">The type of the detector. Default: "lepetit"</param>
		/// <param name="detectorParamName">The detector's parameter names. Default: []</param>
		/// <param name="detectorParamValue">Values of the detector's parameters. Default: []</param>
		/// <param name="descriptorParamName">The descriptor's parameter names. Default: []</param>
		/// <param name="descriptorParamValue">Values of the descriptor's parameters. Default: []</param>
		/// <param name="seed">The seed for the random number generator. Default: 42</param>
		// Token: 0x0600045B RID: 1115 RVA: 0x0001A570 File Offset: 0x00018770
		public HDescriptorModel(HImage template, HCamPar camParam, HPose referencePose, string detectorType, HTuple detectorParamName, HTuple detectorParamValue, HTuple descriptorParamName, HTuple descriptorParamValue, int seed)
		{
			IntPtr proc = HalconAPI.PreCall(952);
			HalconAPI.Store(proc, 1, template);
			HalconAPI.Store(proc, 0, camParam);
			HalconAPI.Store(proc, 1, referencePose);
			HalconAPI.StoreS(proc, 2, detectorType);
			HalconAPI.Store(proc, 3, detectorParamName);
			HalconAPI.Store(proc, 4, detectorParamValue);
			HalconAPI.Store(proc, 5, descriptorParamName);
			HalconAPI.Store(proc, 6, descriptorParamValue);
			HalconAPI.StoreI(proc, 7, seed);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(camParam);
			HalconAPI.UnpinTuple(referencePose);
			HalconAPI.UnpinTuple(detectorParamName);
			HalconAPI.UnpinTuple(detectorParamValue);
			HalconAPI.UnpinTuple(descriptorParamName);
			HalconAPI.UnpinTuple(descriptorParamValue);
			num = base.Load(proc, 0, num);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(template);
		}

		/// <summary>
		///   Prepare a descriptor model for interest point matching.
		///   Modified instance represents: The handle to the descriptor model.
		/// </summary>
		/// <param name="template">Input image whose domain will be used to create the model.</param>
		/// <param name="detectorType">The type of the detector. Default: "lepetit"</param>
		/// <param name="detectorParamName">The detector's parameter names. Default: []</param>
		/// <param name="detectorParamValue">Values of the detector's parameters. Default: []</param>
		/// <param name="descriptorParamName">The descriptor's parameter names. Default: []</param>
		/// <param name="descriptorParamValue">Values of the descriptor's parameters. Default: []</param>
		/// <param name="seed">The seed for the random number generator. Default: 42</param>
		// Token: 0x0600045C RID: 1116 RVA: 0x0001A644 File Offset: 0x00018844
		public HDescriptorModel(HImage template, string detectorType, HTuple detectorParamName, HTuple detectorParamValue, HTuple descriptorParamName, HTuple descriptorParamValue, int seed)
		{
			IntPtr proc = HalconAPI.PreCall(953);
			HalconAPI.Store(proc, 1, template);
			HalconAPI.StoreS(proc, 0, detectorType);
			HalconAPI.Store(proc, 1, detectorParamName);
			HalconAPI.Store(proc, 2, detectorParamValue);
			HalconAPI.Store(proc, 3, descriptorParamName);
			HalconAPI.Store(proc, 4, descriptorParamValue);
			HalconAPI.StoreI(proc, 5, seed);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(detectorParamName);
			HalconAPI.UnpinTuple(detectorParamValue);
			HalconAPI.UnpinTuple(descriptorParamName);
			HalconAPI.UnpinTuple(descriptorParamValue);
			num = base.Load(proc, 0, num);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(template);
		}

		// Token: 0x0600045D RID: 1117 RVA: 0x0001A6E8 File Offset: 0x000188E8
		void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
		{
			HSerializedItem hserializedItem = this.SerializeDescriptorModel();
			byte[] value = hserializedItem;
			hserializedItem.Dispose();
			info.AddValue("data", value, typeof(byte[]));
		}

		// Token: 0x0600045E RID: 1118 RVA: 0x0001A720 File Offset: 0x00018920
		[EditorBrowsable(EditorBrowsableState.Never)]
		public HDescriptorModel(SerializationInfo info, StreamingContext context)
		{
			HSerializedItem hserializedItem = new HSerializedItem((byte[])info.GetValue("data", typeof(byte[])));
			this.DeserializeDescriptorModel(hserializedItem);
			hserializedItem.Dispose();
		}

		/// <summary>Serialize object to binary stream in HALCON format</summary>
		// Token: 0x0600045F RID: 1119 RVA: 0x0001A760 File Offset: 0x00018960
		public new void Serialize(Stream stream)
		{
			HSerializedItem hserializedItem = this.SerializeDescriptorModel();
			hserializedItem.Serialize(stream);
			hserializedItem.Dispose();
		}

		/// <summary>Deserialize object from binary stream in HALCON format</summary>
		// Token: 0x06000460 RID: 1120 RVA: 0x0001A774 File Offset: 0x00018974
		public new static HDescriptorModel Deserialize(Stream stream)
		{
			HDescriptorModel hdescriptorModel = new HDescriptorModel();
			HSerializedItem hserializedItem = HSerializedItem.Deserialize(stream);
			hdescriptorModel.DeserializeDescriptorModel(hserializedItem);
			hserializedItem.Dispose();
			return hdescriptorModel;
		}

		// Token: 0x06000461 RID: 1121 RVA: 0x0001A79A File Offset: 0x0001899A
		object ICloneable.Clone()
		{
			return this.Clone();
		}

		// Token: 0x06000462 RID: 1122 RVA: 0x0001A7A4 File Offset: 0x000189A4
		public new HDescriptorModel Clone()
		{
			HSerializedItem hserializedItem = this.SerializeDescriptorModel();
			HDescriptorModel hdescriptorModel = new HDescriptorModel();
			hdescriptorModel.DeserializeDescriptorModel(hserializedItem);
			hserializedItem.Dispose();
			return hdescriptorModel;
		}

		/// <summary>Free the memory of a descriptor model.</summary>
		/// <param name="modelID">Handle of the descriptor model.</param>
		// Token: 0x06000463 RID: 1123 RVA: 0x0001A7CC File Offset: 0x000189CC
		public static void ClearDescriptorModel(HDescriptorModel[] modelID)
		{
			HTuple htuple = HHandleBase.ConcatArray(modelID);
			IntPtr proc = HalconAPI.PreCall(943);
			HalconAPI.Store(proc, 0, htuple);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(htuple);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(modelID);
		}

		/// <summary>
		///   Free the memory of a descriptor model.
		///   Instance represents: Handle of the descriptor model.
		/// </summary>
		// Token: 0x06000464 RID: 1124 RVA: 0x0001A810 File Offset: 0x00018A10
		public void ClearDescriptorModel()
		{
			IntPtr proc = HalconAPI.PreCall(943);
			base.Store(proc, 0);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Deserialize a descriptor model.
		///   Modified instance represents: Handle of the model.
		/// </summary>
		/// <param name="serializedItemHandle">Handle of the serialized item.</param>
		// Token: 0x06000465 RID: 1125 RVA: 0x0001A844 File Offset: 0x00018A44
		public void DeserializeDescriptorModel(HSerializedItem serializedItemHandle)
		{
			this.Dispose();
			IntPtr proc = HalconAPI.PreCall(944);
			HalconAPI.Store(proc, 0, serializedItemHandle);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			num = base.Load(proc, 0, num);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(serializedItemHandle);
		}

		/// <summary>
		///   Serialize a descriptor model.
		///   Instance represents: Handle of a model to be saved.
		/// </summary>
		/// <returns>Handle of the serialized item.</returns>
		// Token: 0x06000466 RID: 1126 RVA: 0x0001A898 File Offset: 0x00018A98
		public HSerializedItem SerializeDescriptorModel()
		{
			IntPtr proc = HalconAPI.PreCall(945);
			base.Store(proc, 0);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HSerializedItem result;
			num = HSerializedItem.LoadNew(proc, 0, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Read a descriptor model from a file.
		///   Modified instance represents: Handle of the model.
		/// </summary>
		/// <param name="fileName">File name.</param>
		// Token: 0x06000467 RID: 1127 RVA: 0x0001A8E0 File Offset: 0x00018AE0
		public void ReadDescriptorModel(string fileName)
		{
			this.Dispose();
			IntPtr proc = HalconAPI.PreCall(946);
			HalconAPI.StoreS(proc, 0, fileName);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			num = base.Load(proc, 0, num);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Write a descriptor model to a file.
		///   Instance represents: Handle of a model to be saved.
		/// </summary>
		/// <param name="fileName">The path and filename of the model to be saved.</param>
		// Token: 0x06000468 RID: 1128 RVA: 0x0001A92C File Offset: 0x00018B2C
		public void WriteDescriptorModel(string fileName)
		{
			IntPtr proc = HalconAPI.PreCall(947);
			base.Store(proc, 0);
			HalconAPI.StoreS(proc, 1, fileName);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Find the best matches of a calibrated descriptor model in an image and return their 3D pose.
		///   Instance represents: The handle to the descriptor model.
		/// </summary>
		/// <param name="image">Input image where the model should be found.</param>
		/// <param name="detectorParamName">The detector's parameter names. Default: []</param>
		/// <param name="detectorParamValue">Values of the detector's parameters. Default: []</param>
		/// <param name="descriptorParamName">The descriptor's parameter names. Default: []</param>
		/// <param name="descriptorParamValue">Values of the descriptor's parameters. Default: []</param>
		/// <param name="minScore">Minimum score of the instances of the models to be found. Default: 0.2</param>
		/// <param name="numMatches">Maximal number of found instances. Default: 1</param>
		/// <param name="camParam">Camera parameter (inner orientation) obtained from camera calibration.</param>
		/// <param name="scoreType">Score type to be evaluated in Score. Default: "num_points"</param>
		/// <param name="score">Score of the found instances according to the ScoreType input.</param>
		/// <returns>3D pose of the object.</returns>
		// Token: 0x06000469 RID: 1129 RVA: 0x0001A968 File Offset: 0x00018B68
		public HPose[] FindCalibDescriptorModel(HImage image, HTuple detectorParamName, HTuple detectorParamValue, HTuple descriptorParamName, HTuple descriptorParamValue, HTuple minScore, int numMatches, HCamPar camParam, HTuple scoreType, out HTuple score)
		{
			IntPtr proc = HalconAPI.PreCall(948);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, image);
			HalconAPI.Store(proc, 1, detectorParamName);
			HalconAPI.Store(proc, 2, detectorParamValue);
			HalconAPI.Store(proc, 3, descriptorParamName);
			HalconAPI.Store(proc, 4, descriptorParamValue);
			HalconAPI.Store(proc, 5, minScore);
			HalconAPI.StoreI(proc, 6, numMatches);
			HalconAPI.Store(proc, 7, camParam);
			HalconAPI.Store(proc, 8, scoreType);
			HalconAPI.InitOCT(proc, 0);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(detectorParamName);
			HalconAPI.UnpinTuple(detectorParamValue);
			HalconAPI.UnpinTuple(descriptorParamName);
			HalconAPI.UnpinTuple(descriptorParamValue);
			HalconAPI.UnpinTuple(minScore);
			HalconAPI.UnpinTuple(camParam);
			HalconAPI.UnpinTuple(scoreType);
			HTuple data;
			num = HTuple.LoadNew(proc, 0, num, out data);
			num = HTuple.LoadNew(proc, 1, num, out score);
			HalconAPI.PostCall(proc, num);
			HPose[] result = HPose.SplitArray(data);
			GC.KeepAlive(this);
			GC.KeepAlive(image);
			return result;
		}

		/// <summary>
		///   Find the best matches of a calibrated descriptor model in an image and return their 3D pose.
		///   Instance represents: The handle to the descriptor model.
		/// </summary>
		/// <param name="image">Input image where the model should be found.</param>
		/// <param name="detectorParamName">The detector's parameter names. Default: []</param>
		/// <param name="detectorParamValue">Values of the detector's parameters. Default: []</param>
		/// <param name="descriptorParamName">The descriptor's parameter names. Default: []</param>
		/// <param name="descriptorParamValue">Values of the descriptor's parameters. Default: []</param>
		/// <param name="minScore">Minimum score of the instances of the models to be found. Default: 0.2</param>
		/// <param name="numMatches">Maximal number of found instances. Default: 1</param>
		/// <param name="camParam">Camera parameter (inner orientation) obtained from camera calibration.</param>
		/// <param name="scoreType">Score type to be evaluated in Score. Default: "num_points"</param>
		/// <param name="score">Score of the found instances according to the ScoreType input.</param>
		/// <returns>3D pose of the object.</returns>
		// Token: 0x0600046A RID: 1130 RVA: 0x0001AA58 File Offset: 0x00018C58
		public HPose FindCalibDescriptorModel(HImage image, HTuple detectorParamName, HTuple detectorParamValue, HTuple descriptorParamName, HTuple descriptorParamValue, double minScore, int numMatches, HCamPar camParam, string scoreType, out double score)
		{
			IntPtr proc = HalconAPI.PreCall(948);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, image);
			HalconAPI.Store(proc, 1, detectorParamName);
			HalconAPI.Store(proc, 2, detectorParamValue);
			HalconAPI.Store(proc, 3, descriptorParamName);
			HalconAPI.Store(proc, 4, descriptorParamValue);
			HalconAPI.StoreD(proc, 5, minScore);
			HalconAPI.StoreI(proc, 6, numMatches);
			HalconAPI.Store(proc, 7, camParam);
			HalconAPI.StoreS(proc, 8, scoreType);
			HalconAPI.InitOCT(proc, 0);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(detectorParamName);
			HalconAPI.UnpinTuple(detectorParamValue);
			HalconAPI.UnpinTuple(descriptorParamName);
			HalconAPI.UnpinTuple(descriptorParamValue);
			HalconAPI.UnpinTuple(camParam);
			HPose result;
			num = HPose.LoadNew(proc, 0, num, out result);
			num = HalconAPI.LoadD(proc, 1, num, out score);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(image);
			return result;
		}

		/// <summary>
		///   Find the best matches of a descriptor model in an image.
		///   Instance represents: The handle to the descriptor model.
		/// </summary>
		/// <param name="image">Input image where the model should be found.</param>
		/// <param name="detectorParamName">The detector's parameter names. Default: []</param>
		/// <param name="detectorParamValue">Values of the detector's parameters. Default: []</param>
		/// <param name="descriptorParamName">The descriptor's parameter names. Default: []</param>
		/// <param name="descriptorParamValue">Values of the descriptor's parameters. Default: []</param>
		/// <param name="minScore">Minimum score of the instances of the models to be found. Default: 0.2</param>
		/// <param name="numMatches">Maximal number of found instances. Default: 1</param>
		/// <param name="scoreType">Score type to be evaluated in Score. Default: "num_points"</param>
		/// <param name="score">Score of the found instances according to the ScoreType input.</param>
		/// <returns>Homography between model and found instance.</returns>
		// Token: 0x0600046B RID: 1131 RVA: 0x0001AB34 File Offset: 0x00018D34
		public HHomMat2D[] FindUncalibDescriptorModel(HImage image, HTuple detectorParamName, HTuple detectorParamValue, HTuple descriptorParamName, HTuple descriptorParamValue, HTuple minScore, int numMatches, HTuple scoreType, out HTuple score)
		{
			IntPtr proc = HalconAPI.PreCall(949);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, image);
			HalconAPI.Store(proc, 1, detectorParamName);
			HalconAPI.Store(proc, 2, detectorParamValue);
			HalconAPI.Store(proc, 3, descriptorParamName);
			HalconAPI.Store(proc, 4, descriptorParamValue);
			HalconAPI.Store(proc, 5, minScore);
			HalconAPI.StoreI(proc, 6, numMatches);
			HalconAPI.Store(proc, 7, scoreType);
			HalconAPI.InitOCT(proc, 0);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(detectorParamName);
			HalconAPI.UnpinTuple(detectorParamValue);
			HalconAPI.UnpinTuple(descriptorParamName);
			HalconAPI.UnpinTuple(descriptorParamValue);
			HalconAPI.UnpinTuple(minScore);
			HalconAPI.UnpinTuple(scoreType);
			HTuple data;
			num = HTuple.LoadNew(proc, 0, num, out data);
			num = HTuple.LoadNew(proc, 1, num, out score);
			HalconAPI.PostCall(proc, num);
			HHomMat2D[] result = HHomMat2D.SplitArray(data);
			GC.KeepAlive(this);
			GC.KeepAlive(image);
			return result;
		}

		/// <summary>
		///   Find the best matches of a descriptor model in an image.
		///   Instance represents: The handle to the descriptor model.
		/// </summary>
		/// <param name="image">Input image where the model should be found.</param>
		/// <param name="detectorParamName">The detector's parameter names. Default: []</param>
		/// <param name="detectorParamValue">Values of the detector's parameters. Default: []</param>
		/// <param name="descriptorParamName">The descriptor's parameter names. Default: []</param>
		/// <param name="descriptorParamValue">Values of the descriptor's parameters. Default: []</param>
		/// <param name="minScore">Minimum score of the instances of the models to be found. Default: 0.2</param>
		/// <param name="numMatches">Maximal number of found instances. Default: 1</param>
		/// <param name="scoreType">Score type to be evaluated in Score. Default: "num_points"</param>
		/// <param name="score">Score of the found instances according to the ScoreType input.</param>
		/// <returns>Homography between model and found instance.</returns>
		// Token: 0x0600046C RID: 1132 RVA: 0x0001AC08 File Offset: 0x00018E08
		public HHomMat2D FindUncalibDescriptorModel(HImage image, HTuple detectorParamName, HTuple detectorParamValue, HTuple descriptorParamName, HTuple descriptorParamValue, double minScore, int numMatches, string scoreType, out double score)
		{
			IntPtr proc = HalconAPI.PreCall(949);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, image);
			HalconAPI.Store(proc, 1, detectorParamName);
			HalconAPI.Store(proc, 2, detectorParamValue);
			HalconAPI.Store(proc, 3, descriptorParamName);
			HalconAPI.Store(proc, 4, descriptorParamValue);
			HalconAPI.StoreD(proc, 5, minScore);
			HalconAPI.StoreI(proc, 6, numMatches);
			HalconAPI.StoreS(proc, 7, scoreType);
			HalconAPI.InitOCT(proc, 0);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(detectorParamName);
			HalconAPI.UnpinTuple(detectorParamValue);
			HalconAPI.UnpinTuple(descriptorParamName);
			HalconAPI.UnpinTuple(descriptorParamValue);
			HHomMat2D result;
			num = HHomMat2D.LoadNew(proc, 0, num, out result);
			num = HalconAPI.LoadD(proc, 1, num, out score);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(image);
			return result;
		}

		/// <summary>
		///   Query the interest points of the descriptor model or the last processed search image.
		///   Instance represents: The handle to the descriptor model.
		/// </summary>
		/// <param name="set">Set of interest points. Default: "model"</param>
		/// <param name="subset">Subset of interest points. Default: "all"</param>
		/// <param name="row">Row coordinates of interest points.</param>
		/// <param name="column">Column coordinates of interest points.</param>
		// Token: 0x0600046D RID: 1133 RVA: 0x0001ACC8 File Offset: 0x00018EC8
		public void GetDescriptorModelPoints(string set, HTuple subset, out HTuple row, out HTuple column)
		{
			IntPtr proc = HalconAPI.PreCall(950);
			base.Store(proc, 0);
			HalconAPI.StoreS(proc, 1, set);
			HalconAPI.Store(proc, 2, subset);
			HalconAPI.InitOCT(proc, 0);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(subset);
			num = HTuple.LoadNew(proc, 0, num, out row);
			num = HTuple.LoadNew(proc, 1, num, out column);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Query the interest points of the descriptor model or the last processed search image.
		///   Instance represents: The handle to the descriptor model.
		/// </summary>
		/// <param name="set">Set of interest points. Default: "model"</param>
		/// <param name="subset">Subset of interest points. Default: "all"</param>
		/// <param name="row">Row coordinates of interest points.</param>
		/// <param name="column">Column coordinates of interest points.</param>
		// Token: 0x0600046E RID: 1134 RVA: 0x0001AD38 File Offset: 0x00018F38
		public void GetDescriptorModelPoints(string set, int subset, out HTuple row, out HTuple column)
		{
			IntPtr proc = HalconAPI.PreCall(950);
			base.Store(proc, 0);
			HalconAPI.StoreS(proc, 1, set);
			HalconAPI.StoreI(proc, 2, subset);
			HalconAPI.InitOCT(proc, 0);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			num = HTuple.LoadNew(proc, 0, num, out row);
			num = HTuple.LoadNew(proc, 1, num, out column);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Return the parameters of a descriptor model.
		///   Instance represents: The object handle to the descriptor model.
		/// </summary>
		/// <param name="detectorParamName">The detectors parameter names.</param>
		/// <param name="detectorParamValue">Values of the detectors parameters.</param>
		/// <param name="descriptorParamName">The descriptors parameter names.</param>
		/// <param name="descriptorParamValue">Values of the descriptors parameters.</param>
		/// <returns>The type of the detector.</returns>
		// Token: 0x0600046F RID: 1135 RVA: 0x0001ADA4 File Offset: 0x00018FA4
		public string GetDescriptorModelParams(out HTuple detectorParamName, out HTuple detectorParamValue, out HTuple descriptorParamName, out HTuple descriptorParamValue)
		{
			IntPtr proc = HalconAPI.PreCall(951);
			base.Store(proc, 0);
			HalconAPI.InitOCT(proc, 0);
			HalconAPI.InitOCT(proc, 1);
			HalconAPI.InitOCT(proc, 2);
			HalconAPI.InitOCT(proc, 3);
			HalconAPI.InitOCT(proc, 4);
			int num = HalconAPI.CallProcedure(proc);
			string result;
			num = HalconAPI.LoadS(proc, 0, num, out result);
			num = HTuple.LoadNew(proc, 1, num, out detectorParamName);
			num = HTuple.LoadNew(proc, 2, num, out detectorParamValue);
			num = HTuple.LoadNew(proc, 3, num, out descriptorParamName);
			num = HTuple.LoadNew(proc, 4, num, out descriptorParamValue);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Create a descriptor model for calibrated perspective matching.
		///   Modified instance represents: The handle to the descriptor model.
		/// </summary>
		/// <param name="template">Input image whose domain will be used to create the model.</param>
		/// <param name="camParam">The parameters of the internal orientation of the camera.</param>
		/// <param name="referencePose">The reference pose of the object in the reference image.</param>
		/// <param name="detectorType">The type of the detector. Default: "lepetit"</param>
		/// <param name="detectorParamName">The detector's parameter names. Default: []</param>
		/// <param name="detectorParamValue">Values of the detector's parameters. Default: []</param>
		/// <param name="descriptorParamName">The descriptor's parameter names. Default: []</param>
		/// <param name="descriptorParamValue">Values of the descriptor's parameters. Default: []</param>
		/// <param name="seed">The seed for the random number generator. Default: 42</param>
		// Token: 0x06000470 RID: 1136 RVA: 0x0001AE38 File Offset: 0x00019038
		public void CreateCalibDescriptorModel(HImage template, HCamPar camParam, HPose referencePose, string detectorType, HTuple detectorParamName, HTuple detectorParamValue, HTuple descriptorParamName, HTuple descriptorParamValue, int seed)
		{
			this.Dispose();
			IntPtr proc = HalconAPI.PreCall(952);
			HalconAPI.Store(proc, 1, template);
			HalconAPI.Store(proc, 0, camParam);
			HalconAPI.Store(proc, 1, referencePose);
			HalconAPI.StoreS(proc, 2, detectorType);
			HalconAPI.Store(proc, 3, detectorParamName);
			HalconAPI.Store(proc, 4, detectorParamValue);
			HalconAPI.Store(proc, 5, descriptorParamName);
			HalconAPI.Store(proc, 6, descriptorParamValue);
			HalconAPI.StoreI(proc, 7, seed);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(camParam);
			HalconAPI.UnpinTuple(referencePose);
			HalconAPI.UnpinTuple(detectorParamName);
			HalconAPI.UnpinTuple(detectorParamValue);
			HalconAPI.UnpinTuple(descriptorParamName);
			HalconAPI.UnpinTuple(descriptorParamValue);
			num = base.Load(proc, 0, num);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(template);
		}

		/// <summary>
		///   Prepare a descriptor model for interest point matching.
		///   Modified instance represents: The handle to the descriptor model.
		/// </summary>
		/// <param name="template">Input image whose domain will be used to create the model.</param>
		/// <param name="detectorType">The type of the detector. Default: "lepetit"</param>
		/// <param name="detectorParamName">The detector's parameter names. Default: []</param>
		/// <param name="detectorParamValue">Values of the detector's parameters. Default: []</param>
		/// <param name="descriptorParamName">The descriptor's parameter names. Default: []</param>
		/// <param name="descriptorParamValue">Values of the descriptor's parameters. Default: []</param>
		/// <param name="seed">The seed for the random number generator. Default: 42</param>
		// Token: 0x06000471 RID: 1137 RVA: 0x0001AF0C File Offset: 0x0001910C
		public void CreateUncalibDescriptorModel(HImage template, string detectorType, HTuple detectorParamName, HTuple detectorParamValue, HTuple descriptorParamName, HTuple descriptorParamValue, int seed)
		{
			this.Dispose();
			IntPtr proc = HalconAPI.PreCall(953);
			HalconAPI.Store(proc, 1, template);
			HalconAPI.StoreS(proc, 0, detectorType);
			HalconAPI.Store(proc, 1, detectorParamName);
			HalconAPI.Store(proc, 2, detectorParamValue);
			HalconAPI.Store(proc, 3, descriptorParamName);
			HalconAPI.Store(proc, 4, descriptorParamValue);
			HalconAPI.StoreI(proc, 5, seed);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(detectorParamName);
			HalconAPI.UnpinTuple(detectorParamValue);
			HalconAPI.UnpinTuple(descriptorParamName);
			HalconAPI.UnpinTuple(descriptorParamValue);
			num = base.Load(proc, 0, num);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(template);
		}

		/// <summary>
		///   Query alphanumerical results that were accumulated during descriptor-based matching.
		///   Instance represents: Handle of a descriptor model.
		/// </summary>
		/// <param name="objectID">Handle of the object for which the results are queried. Default: "all"</param>
		/// <param name="resultNames">Name of the results to be queried. Default: "num_points"</param>
		/// <returns>Returned results.</returns>
		// Token: 0x06000472 RID: 1138 RVA: 0x0001AFB0 File Offset: 0x000191B0
		public HTuple GetDescriptorModelResults(HTuple objectID, string resultNames)
		{
			IntPtr proc = HalconAPI.PreCall(954);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, objectID);
			HalconAPI.StoreS(proc, 2, resultNames);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(objectID);
			HTuple result;
			num = HTuple.LoadNew(proc, 0, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Query alphanumerical results that were accumulated during descriptor-based matching.
		///   Instance represents: Handle of a descriptor model.
		/// </summary>
		/// <param name="objectID">Handle of the object for which the results are queried. Default: "all"</param>
		/// <param name="resultNames">Name of the results to be queried. Default: "num_points"</param>
		/// <returns>Returned results.</returns>
		// Token: 0x06000473 RID: 1139 RVA: 0x0001B010 File Offset: 0x00019210
		public HTuple GetDescriptorModelResults(int objectID, string resultNames)
		{
			IntPtr proc = HalconAPI.PreCall(954);
			base.Store(proc, 0);
			HalconAPI.StoreI(proc, 1, objectID);
			HalconAPI.StoreS(proc, 2, resultNames);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HTuple result;
			num = HTuple.LoadNew(proc, 0, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Return the origin of a descriptor model.
		///   Instance represents: Handle of a descriptor model.
		/// </summary>
		/// <param name="row">Position of origin in row direction.</param>
		/// <param name="column">Position of origin in column direction.</param>
		// Token: 0x06000474 RID: 1140 RVA: 0x0001B068 File Offset: 0x00019268
		public void GetDescriptorModelOrigin(out HTuple row, out HTuple column)
		{
			IntPtr proc = HalconAPI.PreCall(955);
			base.Store(proc, 0);
			HalconAPI.InitOCT(proc, 0);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			num = HTuple.LoadNew(proc, 0, num, out row);
			num = HTuple.LoadNew(proc, 1, num, out column);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Return the origin of a descriptor model.
		///   Instance represents: Handle of a descriptor model.
		/// </summary>
		/// <param name="row">Position of origin in row direction.</param>
		/// <param name="column">Position of origin in column direction.</param>
		// Token: 0x06000475 RID: 1141 RVA: 0x0001B0C0 File Offset: 0x000192C0
		public void GetDescriptorModelOrigin(out double row, out double column)
		{
			IntPtr proc = HalconAPI.PreCall(955);
			base.Store(proc, 0);
			HalconAPI.InitOCT(proc, 0);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			num = HalconAPI.LoadD(proc, 0, num, out row);
			num = HalconAPI.LoadD(proc, 1, num, out column);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Sets the origin of a descriptor model.
		///   Instance represents: Handle of a descriptor model.
		/// </summary>
		/// <param name="row">Translation of origin in row direction. Default: 0</param>
		/// <param name="column">Translation of origin in column direction. Default: 0</param>
		// Token: 0x06000476 RID: 1142 RVA: 0x0001B118 File Offset: 0x00019318
		public void SetDescriptorModelOrigin(HTuple row, HTuple column)
		{
			IntPtr proc = HalconAPI.PreCall(956);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, row);
			HalconAPI.Store(proc, 2, column);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(row);
			HalconAPI.UnpinTuple(column);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Sets the origin of a descriptor model.
		///   Instance represents: Handle of a descriptor model.
		/// </summary>
		/// <param name="row">Translation of origin in row direction. Default: 0</param>
		/// <param name="column">Translation of origin in column direction. Default: 0</param>
		// Token: 0x06000477 RID: 1143 RVA: 0x0001B168 File Offset: 0x00019368
		public void SetDescriptorModelOrigin(double row, double column)
		{
			IntPtr proc = HalconAPI.PreCall(956);
			base.Store(proc, 0);
			HalconAPI.StoreD(proc, 1, row);
			HalconAPI.StoreD(proc, 2, column);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}
	}
}
